<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
     div {
            width: 200px;
            height: 200px;
            background-color: pink;
        }
    .one{
        width: 300px;
            height: 300px;
            background-color: hotpink;
            margin-left: 100px;
    }
</style>
<body>
    <div class="active" >
    </div>
    <script>
        //1.获取元素对象
        let box=document.querySelector('.active')
        box.className="one"
    </script>
</body>
</html>